package com.xbongbong.saas.help;

import java.util.Objects;

public class BatchKeyHelp {

    /**
     * 获取拼装好的batchKey
     * @param productId
     * @param warehouseId
     * @param batch
     * @param produceDate
     * @param guaranteePeriod
     * @return
     */
    public static String getBatchKey(Long productId, Long warehouseId, String batch, Long produceDate, Long guaranteePeriod) {
        produceDate = Objects.isNull(produceDate) ? 0L : produceDate;
        guaranteePeriod = Objects.isNull(guaranteePeriod) ? 0L : guaranteePeriod;
        return productId + "_" + warehouseId + "_" + batch + "_" + produceDate + "_" + guaranteePeriod;
    }
}
